home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 October / Macformat17.cdr / Shareware City / Education / RLaB / rlib / save.r < prev    next >
Encoding:
Text File  |  1994-06-18  |  571 b   |  32 lines  |  [TEXT/ttxt]

  1. //-------------------------------------------------------------------//
  2.  
  3. //  Syntax:    save ( )
  4. //        save ( FILE )
  5.  
  6. //  Description:
  7.  
  8. //  The save function writes the contents of all the workspace
  9. //  variables to a file. The default file, if none is specified is
  10. //  "SAVE".
  11. //
  12.  
  13. //-------------------------------------------------------------------//
  14.  
  15. save = function ( FILE )
  16. {
  17.   local (i);
  18.  
  19.   if (!exist (FILE))
  20.   {
  21.     FILE = "SAVE";
  22.   }
  23.   for (i in members ($$))
  24.   {
  25.     if (class ($$.[i]) != "function")
  26.     {
  27.       writeb (FILE, $$.[i]);
  28.     }
  29.   }
  30.   close (FILE);
  31. };
  32.